import { createSlice } from "@reduxjs/toolkit";

const UserSlice = createSlice({
    name: 'user',
    initialState: {
        name: '',
        age: 1
    },
    reducers: {
        changeName(state, action) {
            state.name = action.payload
        },
        changeAge(state, action) {
            state.age = action.payload
        }
    }
})

export const { changeName, changeAge } = UserSlice.actions
export default UserSlice.reducer